const pluginName = 'DoneNextPlugin'

const path = require('path')
class DoneNextPlugin {
    constructor (options) {
        this.success = options.success
        this.failed = options.failed
    }
    apply (compiler) {
        compiler.hooks.done.tap(pluginName, stats => {
            this.success(stats)
        })
        compiler.hooks.failed.tap(pluginName, error => {
            this.failed(error)
        })
    }
}

module.exports = DoneNextPlugin
